package org.example.journal_items.utils;

import java.security.SecureRandom;
import java.util.Base64;

public class KeyGenerator {
  public static void main(String[] args) {
    // 生成 64 字节的随机密钥
    byte[] keyBytes = new byte[64];
    new SecureRandom().nextBytes(keyBytes);

    // 将密钥编码为 Base64 字符串
    String base64Key = Base64.getEncoder().encodeToString(keyBytes);

    System.out.println("Generated JWT Secret Key:");
    System.out.println(base64Key);
    System.out.println("\nPlease copy this key into your application.properties file as the value for jwt.secret");
  }
}